package 笔试;

import java.util.Scanner;

public class 图像翻转 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int[][] nums = new int[num][4*num];
        for(int i = 0 ;i < num; i++) {
            for (int j = 0; j < 4 * num; j++) {
                nums[i][j] = scan.nextInt();
            }
        }
        for(int i = num/2; i < num; i++) {
            for(int j = 0; j < 4*num; j++) {
                System.out.print(nums[i][j] + ',');
            }
        }
        for(int i = 0; i < num/2; i++) {
            for(int j = 0; j < 4*num; j++) {
                if(i == num/2-1 && j == 4*num-1) {
                    System.out.print(nums[i][j]);
                } else {
                    System.out.print(nums[i][j] + ',');
                }
            }
        }
    }
}

